<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Historywarn extends Model
{
   use \App\Models\Traits\ScopeCompanySite;
   use \App\Models\Traits\Site;
    
    protected $table = 't_historywarn';
    
    protected $primaryKey = 'hw_index';
    
    protected $fillable = [
    
    ];
    
    public $timestamps = false;
    
    public function getCompanyField() {
        return 'Co_ID';
    }
    
    public function getSiteField() {
        return 'Fid';
    }
    
    //告警内容
    public function warndefine() {
        return $this->hasOne('\App\Models\WarnDefine', 'wd_index', 'wd_index');
    }

    public function area() {
        return $this->hasOne('\App\Models\Area', 'AreaId', 'Fid');
    }
}
